package com.example.demo.test.myThread.model;

/**
 *
 * 资源类 User
 * 生产类 SetUserThread
 * 消费类 GetUserThread
 * 测试类 UserDemo
 *
 */
public class UserDemo {
    public static void main(String[] args) {
        // 创建资源，保证不同线程使用的是同一资源
        User user = new User();
        Thread thread1 = new Thread(new SetUserThread(user));
        Thread thread2 = new Thread(new GetUserThread(user));

        thread1.start();
        thread2.start();


    }
}
